package org.cainiao.servlet.message.rocketmq.samples.consumer;

import lombok.RequiredArgsConstructor;
import org.apache.rocketmq.spring.core.RocketMQTemplate;

import java.util.List;

@RequiredArgsConstructor
public class PullConsumerApplication {

    private final RocketMQTemplate rocketMQTemplate;

    public void run() {
        for (int i = 0; i < 100; i++) {
            List<String> messages = rocketMQTemplate.receive(String.class);
            System.out.println(messages);
        }
    }
}
